/*
 *  Copyright 2004 Blandware (http://www.blandware.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.blandware.atleap.webapp.form.core;

import com.blandware.atleap.webapp.form.BaseForm;
import org.apache.struts.action.ActionMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>Base Action Form for all filter types.
 * </p>
 * <p><a href="BaseFilterForm.java.html"><i>View Source</i></a></p>
 * <p/>
 *
 * @author Sergey Zubtsovskiy <a href="mailto:sergey.zubtsovskiy@blandware.com">&lt;sergey.zubtsovskiy@blandware.com&gt;</a>
 * @version $Revision: 1.9 $ $Date: 2006/08/03 10:08:05 $
 */
public class BaseFilterForm extends BaseForm {

	protected String fieldName = new String();
	protected String gridName = new String();
	protected String pageUrl = new String();
	protected String fieldKey = null;
	protected String clearFilter = null;
	protected String rowIterators = null;

	/**
	 * Creates the new instance of FilterRowsForm
	 */
	public BaseFilterForm() {
	}

    /**
     * Returns name of field to which this filter is assigned
     *
     * @return name of field
     */
	public String getFieldName() {
		return fieldName;
	}

    /**
     * Sets name of field to which this filter is assigned
     *
     * @param fieldName name of field to set
     */
	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}

    /**
     * Returns name of grid to which this filter belongs
     *
     * @return name of grid
     */
	public String getGridName() {
		return gridName;
	}

    /**
     * Sets name of grid to which this filter belongs
     *
     * @param gridName name of grid
     */
	public void setGridName(String gridName) {
		this.gridName = gridName;
	}

    /**
     * Returns URL of page on which the filtered field is located
     *
     * @return URL of page
     */
	public String getPageUrl() {
		return pageUrl;
	}

    /**
     * Sets URL of page on which the filtered field is located
     *
     * @param pageUrl URL of page to set
     */
	public void setPageUrl(String pageUrl) {
		this.pageUrl = pageUrl;
	}

    /**
     * Returns i18n key under which a localized field name is stored
     *
     * @return field i18n key
     */
	public String getFieldKey() {
		return fieldKey;
	}

    /**
     * Sets i18n key under which a localized field name is stored
     *
     * @param fieldKey field i18n key
     */
	public void setFieldKey(String fieldKey) {
		this.fieldKey = fieldKey;
	}

    /**
     * If the returned value is not <code>null</code>, the filter will be
     * cleared
     *
     * @return whether filter will be cleared
     */
	public String getClearFilter() {
		return clearFilter;
	}

    /**
     * If the set value is not <code>null</code>, the filter will be
     * cleared
     */
	public void setClearFilter(String clearFilter) {
		this.clearFilter = clearFilter;
	}

    /**
     * Returns row iterators
     *
     * @return row iterators
     */
	public String getRowIterators() {
		return rowIterators;
	}

    /**
     * Sets row iterators
     *
     * @param rowIterators row iterators to set
     */
	public void setRowIterators(String rowIterators) {
		this.rowIterators = rowIterators;
	}

	/**
	 * Resets all properties to their default properties
	 *
	 * @param mapping The ActionMapping used to select this instance
	 * @param request The non-http request we are proceeding
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		this.fieldKey = null;
		this.rowIterators = null;
	}

}